package online.sixfish.common.eunmration;

import java.util.Arrays;
import java.util.List;

public enum UserQueProgramRelationshipEnum {
    NOT_STARTED(1, "未开始"),
    TRIED(2, "尝试过"),
    SOLVED(3, "已解答");

    private final int id;
    private final String desc;

    UserQueProgramRelationshipEnum(int id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public int getId() {
        return id;
    }

    public String getDesc() {
        return desc;
    }

    public static UserQueProgramRelationshipEnum getById(int id) {
        for (UserQueProgramRelationshipEnum relationship : UserQueProgramRelationshipEnum.values()) {
            if (id == relationship.id) {
                return relationship;
            }
        }
        return null;
    }

    public static List<UserQueProgramRelationshipEnum> getAllRelationships() {
        return Arrays.asList(UserQueProgramRelationshipEnum.values());
    }
}
